/*
 * @Author: lmk
 * @Date: 2022-04-15 21:39:36
 * @LastEditTime: 2022-04-16 11:24:32
 * @LastEditors: lmk
 * @Description: 
 */

import { createI18n } from 'vue-i18n'
import enUS from './en-US';
import zhCN from './zh-CN';
const i18n = createI18n({
  legacy: false,
  locale: localStorage.lang || navigator.language.toLowerCase() || 'zh',
  globalInjection: true, // 全局注册 $t方法
  FallbackLocale: 'zh',
  datetimeFormats:{
    en: {
      short: {
        year: 'numeric', month: 'short'
      },
    },
    zh: {
      short: {
        year: 'numeric', month: 'short'
      }
    }
  },
  messages: {
    'zh': zhCN,
    'en': enUS
  }
})

export default i18n; 